//
//  DemoViewController.swift
//  weiboDemo
//
//  Created by zq on 2020/10/28.
//

import UIKit

class DemoViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第 \(navigationController?.viewControllers.count ?? 0) 个"
        
    }
    
    @objc private func showNext() -> () {
        let vc = DemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
    
    
    
}

extension DemoViewController{
    
    override func setupUI() {
        super.setupUI()
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
        
//        let btn:UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        
        
        navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "下一个", target: self, action: #selector(showNext))
    }
}
